package daily;

import java.util.Scanner;

/**
 * http://lx.lanqiao.cn/problem.page?gpid=T2766
 * 
 * @author Jia
 *
 */
public class day3_11_3 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();

		for (int i = 0; i <= Math.sqrt(n); i++) {
			for (int j = i; j <= Math.sqrt(n - i * i); j++) {
				for (int k = j; k <= Math.sqrt(n - i * i - j * j); k++) {
					if (Math.sqrt(n - i * i - j * j - k * k) == (int) Math.sqrt(n - i * i - j * j - k * k)) {
						System.out.println(i + " " + j + " " + k + " " + (int) Math.sqrt(n - i * i - j * j - k * k));
						return;
					}
				}
			}
		}
	}
}
